package com.jwdf.uda.ui.adapter.viewholder;

import android.databinding.DataBindingUtil;
import android.view.View;
import com.jwdf.uda.databinding.ItemQuizMainBinding;
import com.jwdf.uda.ui.adapter.AbsViewHolder;
import com.jwdf.uda.ui.adapter.item.QuizDetailItem;
import com.jwdf.uda.utils.StringUtils;

/**
 * Created by Administrator on 2016/9/6.
 */
public class QuizMainViewHolder extends AbsViewHolder<QuizDetailItem> {
    private ItemQuizMainBinding mItemBinding;

    public QuizMainViewHolder(View convertView) {
        super(convertView);
        mItemBinding = DataBindingUtil.bind(convertView);
        convertView.setOnClickListener(this);
//        mItemBinding.llHeadLayout.setOnClickListener(this);
    }

    @Override
    protected void onBindView(QuizDetailItem item) {
//        PbBean.PbUserSimple userInfo = item.userInfo;
//        if(userInfo == null) return;
//        ImageLoader.getInstance().displayImage(userInfo.getAvatar().getUrl(), mItemBinding.ivHeader);
//        mItemBinding.tvName.setText(StringUtils.filterNullAndTrim(userInfo.getNickname()));
        mItemBinding.tvTitle.setText(StringUtils.filterNullAndTrim(item.quizTitle));
    }

//    @Override
//    public void onClick(View v) {
//        if (v.getId() == R.id.ll_head_layout) {
//            UserInfoActivity.start(v.getContext(), item.userInfo.getUserId(), item.userInfo.getIsDesigner());
//            return;
//        }
//    }
}
